<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html 
		xmlns="http://www.w3.org/1999/xhtml"
		xmlns:p="http://primefaces.org/ui"
		xmlns:h="http://java.sun.com/jsf/html"
		xmlns:f="http://java.sun.com/jsf/core"
		>
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>#{rotulos.changeMetric}</title>
</h:head>
<h:body>
<p:menubar>
          <p:menuitem value="Home" url="../views/home.jsf"/>
    <p:submenu label="#{rotulos.labelMenuMetricsCategories}" icon="ui-icon-document">
        <p:menuitem value="#{rotulos.labelConsultCategory}" url="../views/consultCategory.jsf"/>
    </p:submenu>
    <p:submenu label="#{rotulos.labelMenuMetrics}" icon="ui-icon-document">
        <p:menuitem value="#{rotulos.labelImportMetrics}" url="../views/registerMetric.jsf"/>
        <p:menuitem value="#{rotulos.labelConsultMetric}" url="../views/consultMetric.jsf" />
        
    </p:submenu>
    <p:submenu label="#{rotulos.labelMenuMetricProjects}" icon="ui-icon-document">
        <p:menuitem value="#{rotulos.labelHeaderCreateProject}" url="../views/createProject.jsf"/>
        <p:menuitem value="#{rotulos.labelConsultProject}" url="../views/consultProject.jsf"/>
    </p:submenu>
    
    <p:submenu label="#{rotulos.labelAdmin}" icon="ui-icon-document" rendered="#{userController.admin}">
        <p:menuitem value="#{rotulos.labelImportMetrics}" url="../admin/registerMetricAdmin.jsf"/>
        <p:menuitem value="#{rotulos.labelConsultMetric}" url="../admin/consultMetricAdmin.jsf"/>
        <p:menuitem value="#{rotulos.labelConsultUser}" url="../admin/consultUser.jsf"/>
        <p:menuitem value="#{rotulos.labelCreateCategory}" url="../admin/registerCategory.jsf"/>
        <p:menuitem value="#{rotulos.labelConsultCategory}" url="../admin/consultCategoryAdmin.jsf"/>
    </p:submenu>
    
    <f:facet name="options">
        <form action="/MetricTools/logoutServlet" method="get">
            <h:commandButton type="submit" value="#{rotulos.labelLogout}"/>
        </form>
    </f:facet>
</p:menubar>

<center>
    <p:panel header="#{rotulos.changeMetric}" style="text-align:left;width:700px;">
    <h1><center>#{rotulos.changeMetric}</center></h1>
        <div align="center">
            <h:form id ="teste">
		<h:panelGrid cellpadding="5" columns="3">
			<h:outputLabel value="#{rotulos.nameMetric}" for="nome"/>
                        <h:inputText id="name" value="#{registerController.metric.name}" disabled="true"/><br/>
                        
                        <h:outputLabel value="#{rotulos.labelType}"/>
                        <h:inputText id="type" value="#{registerController.metric.type}" disabled="true"/><br/>
                        
                        <h:outputLabel value="#{rotulos.labelDomain}"/>
                        <h:inputText id="domain" value="#{registerController.metric.domain}" disabled="true" /><br/>
                        
                        <h:outputLabel value="#{rotulos.labelDescription}"/>
                        <h:inputText id="description" value="#{registerController.metric.description}" /><br/>
                        
                        <h:outputLabel value="#{rotulos.category}" />
                        <h:selectOneMenu value="#{registerController.metric.category.category_id}" id="category" disabled="true">
                            <f:selectItem itemValue="" itemLabel="#{rotulos.textSelectCategory}"/>
                            <f:selectItems value="#{registerController.category}"/>
			</h:selectOneMenu><br/> 
			<center>
                            <p:commandButton ajax="false" action="#{registerController.changeMetric}" value="#{rotulos.labelChange}"/>
                            <p:commandButton ajax="false" action="#{registerController.clearMetric}" value="#{rotulos.labelClear}"/>
			</center>
		
		</h:panelGrid>
                
            </h:form>
                <h:messages infoStyle="color: green" errorStyle="color: red"/><br/>
	</div>
</p:panel>
</center>
</h:body>
</html>
